package com.gz.logistics.library.pojo;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016-04-28.
 */
public class ClothesBug extends CustomerSpinnerObject {
    private int id ;
    private String flawsnote;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getFlawsnote() {
        return flawsnote;
    }

    public void setFlawsnote(String flawsnote) {
        this.flawsnote = flawsnote;
    }
    public String toString(){return flawsnote;}
    public static List<ClothesBug> parse(JSONArray jsonArray) throws JSONException {
        if (jsonArray == null || jsonArray.length() <= 0){
            return null;
        }
        List<ClothesBug> buglist = new ArrayList<ClothesBug>();
        for (int i = 0 ; i < jsonArray.length() ; i ++ ){
            ClothesBug info = new ClothesBug();
            info.id = (jsonArray.getJSONObject(i)).getInt("id");
            info.flawsnote = (jsonArray.getJSONObject(i)).getString("flaws_note");
            buglist.add(info);
        }
        return buglist;
    }

}
